<div class="layui-input-inline">
    <a class="layui-btn model-a" href="{:url('Friend/addcompany')}" data-title="添加单位">添加单位</a>
</div>
<table class="layui-table" lay-filter="edit-table" lay-data="{method: 'post',loading:'true', url:'{:url('Friend/company')}', page:true, id:'idDemo'}" lay-filter="test">
    <thead>
    <tr>
        <th lay-data="{field:'company_name'}">单位名称</th>
        <th lay-data="{field:'company_address'}">地址</th>
        <th lay-data="{field:'downnum'}">下属单位数量</th>
        <th lay-data="{toolbar:'#info',width:180,}">操作</th>
    </tr>
    </thead>
</table>
<script type="text/html" id="info">
    {{#  if(d.company_status == 1){ }}
    <a class="layui-btn layui-btn-normal layui-btn-xs  edit-table ajax-delete delete" data-title="禁用" data-msg="确认禁用吗禁用后下属单位及用户都会禁用！" href="{:url('Friend/down')}?company_id={{d.company_id}}">禁用</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs  edit-table ajax-delete delete" data-title="删除单位" data-msg="确认删除此单位？" href="{:url('Friend/delcompany')}?company_id={{d.company_id}}">删除</a>
    {{#  } else if(d.company_status == 2){ }}
    <a class="layui-btn layui-btn-normal layui-btn-xs  edit-table ajax-delete delete" data-title="启用" data-msg="确认启用？" href="{:url('Friend/open')}?company_id={{d.company_id}}">启用</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs  edit-table ajax-delete delete" data-title="删除单位" data-msg="确认删除此单位？" href="{:url('Friend/delcompany')}?company_id={{d.company_id}}">删除</a>
    {{#  } }}
</script>


